Skip to content

fix: strip UTF-8 BOM before JSON.parse in config#384

Closed
nanaubusiness wants to merge 2 commits into
DietrichGebert:mainfrom
nanaubusiness:fix/config-bom
Closed

fix: strip UTF-8 BOM before JSON.parse in config#384
nanaubusiness wants to merge 2 commits into
DietrichGebert:mainfrom
nanaubusiness:fix/config-bom

Conversation

@nanaubusiness

Copy link
Copy Markdown
Contributor

Unlike ponytail-activate.js and check-versions.js, this function did not strip BOM before parsing. Config files saved with BOM (common on Windows) silently failed to parse, ignoring user settings.

Closes #375

Admin added 2 commits June 27, 2026 20:07
Previously uninstall deleted the entire statusLine key when it found
'ponytail-statusline' in the command string. Combined statuslines
(e.g. caveman+ponytail) would lose other plugins' statuslines.
Now only deletes the command field.

Closes DietrichGebert#374
Unlike ponytail-activate.js and check-versions.js, this function
did not strip BOM before parsing. Config files saved with BOM (common
on Windows) silently failed to parse.

Closes DietrichGebert#375
@DietrichGebert

Copy link
Copy Markdown
Owner

Thanks @nanaubusiness. I reconciled the #375 fix as #478 (merged) and credited you as co-author. Two changes from this PR: it uses the repo /^/ escape rather than a literal BOM character in the source (an invisible source char is fragile and can be stripped by editors/linters), and it drops the scripts/uninstall.js hunk here since that duplicates your dedicated PR #383 (which belongs to #374 and stays open on its own). Closing this in favor of #478.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hooks/ponytail-config.js: JSON.parse doesn't strip BOM — config silently fails on Windows

2 participants